package com.gaozhaoyang.base;

import com.gaozhaoyang.entity.User;
import org.junit.Test;

import java.util.List;

public class UserServer1 {
    UserDao1 dao = new UserDao1();
    @Test
    public void findUser(){
        String sql = "select * from user where uid =?";
        User user = dao.getEntity(sql, User.class, 2);
        System.out.println(user);
    }
    @Test
    public void findAll() {
        String sql = "select * from user";
        List<User> userList = dao.getListEntity(sql, User.class);
        System.out.println(userList);
    }
    @Test
    public void deleteUser() {
        String sql = "delete from user where uid =?";

        System.out.println(dao.update(sql, 2) > 0 ? "删除成功" : "删除失败");
    }

}
